//// appending to string
//#include <iostream>
//#include <string>
//using namespace std;
//int main()
//{
//	string str;
//	string str2 = "Writing ";
//	string str3 = "print 10 and then 5 more";
//
//	// used in the same order as described above:
//	str.append(str2);                       // "Writing "
//	str.append(str3, 6, 3);                   // "10 "
//	str.append("dots are cool", 5);          // "dots "
//	str.append("here: ");                   // "here: "
//	str.append(10, '.');                    // ".........."
//	str.append(str3.begin() + 8, str3.end());  // " and then 5 more"
//
//	std::cout << str << endl;
//	return 0;
//}

//#include <iostream>
//#include <string>
//using namespace std;
//int main()
//{
//	string str("hello world");
//	str.push_back('!');
//	cout << str << endl;
//
//	str.pop_back();
//	cout << str << endl;
//	return 0;
//}


//// string::assign
//#include <iostream>
//#include <string>
//using namespace std;
//int main()
//{
//	string str;
//	string base = "The quick brown fox jumps over a lazy dog.";
//
//	// used in the same order as described above:
//
//	str.assign(base);
//	cout << str << endl;
//
//	str.assign(base, 10, 9);
//	cout << str << endl;         // "brown fox"
//
//	str.assign("pangrams are cool", 7);
//	cout << str << endl;         // "pangram"
//
//	str.assign("c-string");
//	cout << str << endl;         // "c-string"
//
//	str.assign(10, '*');
//	cout << str << endl;         // "**********"
//
//
//	str.assign(base.begin() + 16, base.end() - 12);
//	cout << str << endl;         // "fox jumps over"
//
//	return 0;
//}


//// inserting into a string
//#include <iostream>
//#include <string>
//using namespace std;
//int main()
//{
//	string str = "to be question";
//	string str2 = "the ";
//	string str3 = "or not to be";
//	string::iterator it;
//
//	// used in the same order as described above:
//	str.insert(6, str2);                 // to be (the )question
//	str.insert(6, str3, 3, 4);             // to be (not )the question
//	str.insert(10, "that is cool", 8);    // to be not (that is )the question
//	str.insert(10, "to be ");            // to be not (to be )that is the question
//	str.insert(15, 1, ':');               // to be not to be(:) that is the question
//	it = str.insert(str.begin() + 5, ','); // to be(,) not to be: that is the question
//	str.insert(str.end(), 3, '.');       // to be, not to be: that is the question(...)
//	str.insert(it + 2, str3.begin(), str3.begin() + 3); // (or )
//
//	cout << str << endl;
//	return 0;
//}

//// string::erase
//#include <iostream>
//#include <string>
//using namespace std;
//int main()
//{
//    std::string str("This is an example sentence.");
//    cout << str << '\n'; 
//                                             // "This is an example sentence."
//    str.erase(10, 8);                        //            ^^^^^^^^
//    cout << str << '\n';
//                                              // "This is an sentence."
//    str.erase(str.begin() + 9);               //           ^
//    cout << str << '\n';
//                                                // "This is a sentence."
//    str.erase(str.begin() + 5, str.end() - 9);  //       ^^^^^
//    cout << str << '\n';
//    // "This sentence."
//    return 0;
//}



//// replacing in a string
//#include <iostream>
//#include <string>
//using namespace std;
//int main()
//{
//	string base = "this is a test string.";
//	string str2 = "n example";
//	string str3 = "sample phrase";
//	string str4 = "useful.";
//
//	// replace signatures used in the same order as described above:
//
//	// Using positions:                 0123456789*123456789*12345
//	string str = base;           // "this is a test string."
//	str.replace(9, 5, str2);          // "this is an example string." (1)
//	str.replace(19, 6, str3, 7, 6);     // "this is an example phrase." (2)
//	str.replace(8, 10, "just a");     // "this is just a phrase."     (3)
//	str.replace(8, 6, "a shorty", 7);  // "this is a short phrase."    (4)
//	str.replace(22, 1, 3, '!');        // "this is a short phrase!!!"  (5)
//
//	// Using iterators:                                               0123456789*123456789*
//	str.replace(str.begin(), str.end() - 3, str3);                    // "sample phrase!!!"      (1)
//	str.replace(str.begin(), str.begin() + 6, "replace");             // "replace phrase!!!"     (3)
//	str.replace(str.begin() + 8, str.begin() + 14, "is coolness", 7);    // "replace is cool!!!"    (4)
//	str.replace(str.begin() + 12, str.end() - 4, 4, 'o');                // "replace is cooool!!!"  (5)
//	str.replace(str.begin() + 11, str.end(), str4.begin(), str4.end());// "replace is useful."    (6)
//	cout << str << '\n';
//	return 0;
//}



//
//#include<iostream>
//#include<string>
//using namespace std;
//int main()
//{
//	string str1("hello");
//	string str2("world");
//	cout << str1 << endl;
//	cout << str2 << endl;
//
//	str1.swap(str2);
//
//	cout << endl;
//	cout << str1 << endl;
//	cout << str2 << endl;
//	return 0;
//}

//// concatenating strings
//#include <iostream>
//#include <string>
//using namespace std;
//int main()
//{
//	string firstlevel("com");
//	string secondlevel("cplusplus");
//	string scheme("http://");
//	string hostname;
//	string url;
//
//	hostname = "www." + secondlevel + '.' + firstlevel;
//	url = scheme + hostname;
//
//	cout << url << '\n';
//	return 0;
//}


//// string comparisons
//#include <iostream>
//#include <vector>
//using namespace std;
//int main()
//{
//	string foo = "alpha";
//	string bar = "beta";
//
//	if (foo == bar) std::cout << "foo and bar are equal\n";
//	if (foo != bar) std::cout << "foo and bar are not equal\n";
//	if (foo < bar) std::cout << "foo is less than bar\n";
//	if (foo > bar) std::cout << "foo is greater than bar\n";
//	if (foo <= bar) std::cout << "foo is less than or equal to bar\n";
//	if (foo >= bar) std::cout << "foo is greater than or equal to bar\n";
//
//	return 0;
//}


/*include<iostream>
#include<string>
using namespace std;
int main()
{
	string str1("hello");
	string str2("world");
	cout << str1 << endl;
	cout << str2 << endl;

	swap(str1, str2);

	cout << endl;
	cout << str1 << endl;
	cout << str2 << endl;
	return 0;
}
*/


//// inserting strings into output streams
//#include <iostream>
//#include <string>
//using namespace std;
//int main()
//{
//	string str;
//	cin >> str;
//	cout << str << '\n';
//	return 0;
//}


// extract to string
#include <iostream>
#include <string>
using namespace std;
int main()
{
	string name;

	cout << "Please, enter your full name: ";
	getline(cin, name);
	cout << "Hello, " << name << "!\n";

	return 0;
}